import { createWebHistory, createRouter } from 'vue-router'
const history = createWebHistory()
const router = createRouter({
	history, // 路由模式
	routes: [
		{
			path: '/home',
			name: 'home',
			component: () => import('../layout/frame/index.vue'),
		
			children: [
				{
					// 页面逻辑
					path: '/home',
					name: 'home',
					component: () => import('../views/home/index.vue'),
					// redirect:'/home/course',
					children: [
						{
							path: 'original',
							name: 'original',
							component: () =>
								import(
									'../views/home/components/homemain/homemain.vue'
								),
						},
					],
				},
			],
		},
		{
			path: '/course',
			name: 'course',
			// component: () => import('../views/course/index.vue'),
			component: () => import('../layout/frame/index.vue'),
			redirect: '/course',
			children: [
				{
					path: '/course',
					name: 'course',
					component: () => import('../views/course/index.vue'),
					redirect: '/course/vipcourse',
					children: [
						{
							path: 'vipcourse',
							name: 'Vipcourse',
							component: () =>
								import('../views/course/vipCourse.vue'),
						},
						{
							path: 'videocourse',
							name: 'Videocourse',
							component: () =>
								import('../views/course/videoCourse.vue'),
						},
						{
							path: 'livecourse',
							name: 'Livecourse',
							component: () =>
								import('../views/course/liveCourse.vue'),
						},
						{
							path: 'theme',
							name: 'Theme',
							component: () =>
								import('../views/course/theme.vue'),
						},
					],
				},
			],
		},
		{
			path: '/detail',
			name: 'Detail',
			component: () => import('../layout/frame/index.vue'),
			children: [
				{
					path: '/detail',
					name: 'Detail',
					component: () =>
						import('../views/course/courseDetail/player/index.vue'),
				},
			],
		},
		{
			// 页面逻辑
			path: '/class',
			name: 'class',
			component: () => import('../views/class/index.vue'),
		},

		{
			// 练习室逻辑
			path: '/practive',
			// name: 'practive',
			// 框架路由
			component: () => import('../layout/frame/index.vue'),
			redirect: '/practive',
			children: [
				{
					// 练习室逻辑
					path: '/practive',
					name: 'practive',
					component: () => import('../views/practiceRoom/practive.vue'),
				},
				// 缓存
				{
					path: 'mediaCache',
					name: 'mediaCache',
					component: () => import('../views/practiceRoom/leftCate/mediaCache.vue'),
				},
				// 收藏
				{
					path: 'Collections',
					name: 'Collections',
					component: () => import('../views/practiceRoom/leftCate/Collections.vue'),
				},
				// 历史
				{
					path: 'viewRecords',
					name: 'viewRecords',
					component: () => import('../views/practiceRoom/leftCate/viewRecords.vue'),


				},
			],
		},

		{
			// 页面逻辑
			path: '/center',
			name: 'center',
			// component: () => import('../views/center/index.vue'),
			component: () => import('../layout/frame/index.vue'),
			redirect: '/center',
			children: [
				{
					path: '/center',
					name: 'center',
					component: () => import('../views/center/index.vue'),
					children: [
						{
							path: 'resource',
							name: 'resource',
							component: () =>
								import('../pages/resource/index.vue'),
						},
						{
							path: 'myinfo',
							name: 'myinfo',
							component: () =>
								import('../pages/myInfo/index.vue'),
						},
						{
							path: 'menbers',
							name: 'menbers',
							component: () =>
								import('../pages/menbers/index.vue'),
						},
						{
							path: '/center',
							redirect: '/center/resource',
						},
					],
				},
			],
		},
		{
			// 登录
			path: '/login',
			name: 'login',
			component: () => import('../pages/longin/index.vue'),
		},
		{
			// 注册
			path: '/register',
			name: 'register',
			component: () => import('../pages/register/index.vue'),
		},
		{
			path: '/',
			component: () => import('../layout/frame/index.vue'),
			redirect: '/home',
			children: [
				{
					// 页面逻辑
					path: 'home',
					name: 'home',
					component: () => import('../views/home/index.vue'),
				},
			],
		},
	],
})
export default router
